<template>
  <div class="weeklySpecial">
    <div class="weeklySpecial-left">
      <img
        src="http://image.ituring.com.cn/09ab8f70-a333-11eb-b7a9-b16899e368e1"
      />
    </div>
    <div
      class="newBook-oneBook"
      @click="handleBookClick(weeklySpecialItem.id)"
      v-for="weeklySpecialItem in weeklyList"
      :key="weeklySpecialItem.id"
    >
      <div class="oneBookImg">
        <img
          v-lazy="`https://file.ituring.com.cn/Original/${weeklySpecialItem.coverKey}`"
          :alt="weeklySpecialItem.name"
        />
      </div>
      <div class="oneBook-text">
        <b class="oneBook-name">{{ weeklySpecialItem.name }}</b>
        <p class="oneBook-author">
          {{ weeklySpecialItem.authorNameString }}（作者）
        </p>
        <p class="oneBook-translator">
          {{
            weeklySpecialItem.translatorNameString
              ? `${weeklySpecialItem.translatorNameString}（译者）`
              : ''
          }}
        </p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'WeeklySpecial',
  props: {
    weeklyList: Array
  },
  methods: {
    handleBookClick(bookId) {
      this.$router.push({
        name: 'BookDetail',
        params: {
          bookId
        }
      })
    }
  }
}
</script>

<style lang="less">
.weeklySpecial {
  width: 1080px;
  height: 280px;
  display: flex;
  justify-content: space-between;
  // border: 1px solid green;
}
.weeklySpecial-left {
  width: 255px;
  height: 280px;
  img {
    width: 255px;
    height: 270px;
  }
}
</style>